import { render } from '@testing-library/react'
import React, { useRef, useState } from 'react'

export default function App() {
    const mytext = useRef<HTMLInputElement>(null)
    const [name, setName] = useState<string>('KEY') //默认隐式类型 可以自己追加    
    return (
        <div>
            {name}
            <button onClick={() => {
                setName('100')
            }}>click</button>
            <input type="text" ref={mytext} />
            <Child name='1111'></Child>
        </div>
    )
}
interface propsTyep {
    name: string
}
function Child(props: propsTyep) {
    return <div>
        {props.name}
    </div>
}